// mapManager.js
import * as mars3d from "mars3d";

let mapInstance = null;

export function createMap(containerId, options) {
  if (mapInstance) {
    return mapInstance;
  }
  mapInstance = new mars3d.Map(containerId, options);
  return mapInstance;
}

export function getMap() {
  return mapInstance;
}

export function destroyMap() {
  if (mapInstance) {
    mapInstance.destroy();
    mapInstance = null;
  }
}
